﻿using System;
using NLog;

namespace WcfService
{
    public class TestService : ITestService
    {
        public bool GetData(string value)
        {
            try
            {
                int count = Convert.ToInt32(value);
                return true;
            }
            catch (Exception exc)
            {
                // Loga custom deger paslamak...
                Logger logger = LogManager.GetLogger("LogToEventLog");
                LogEventInfo theEvent = new LogEventInfo(LogLevel.Info, "CustomLogger", null, "PleaseLogThis -> WCF Servisten Custom değer gonder.", null, exc);
                theEvent.Properties["ID"] = Guid.NewGuid().ToString();
                theEvent.Properties["CustomField"] = "Custom deneme";
                logger.Log(theEvent);
                return false;

            }
        }
    }
}
